<script>
function show_(id){
    for(i=1; i<4;i++){
        if(i==id){
            jQuery('#content_'+i).fadeIn('slow');
            jQuery("#box_tip_"+i).addClass('active');
        }
        else{
            document.getElementById('content_'+i).style.display = "none";
            jQuery("#box_tip_"+i).removeClass('active');
        }
    }
}
</script> 
<?php //var_dump($tab); ?>
<div class="temp2">
    <p><?php echo $this->lang->line('fm_downloads'); ?></p>
</div>

<div class="box_tip">
    <div class="box_tip_1" id="box_tip_1" style="cursor: pointer;" onclick="show_(1);">
        <div class="box_tip_text_1">
            <div class="f16px"><?php echo $tab[0]['cname'] ?></div>
            <div><?php echo $tab[0]['cintro'] ?></div>
        </div>
    </div>
    <div class="box_tip_2" id="box_tip_2" style="cursor: pointer;" onclick="show_(2);">
        <div class="box_tip_text_2">
            <div class="f16px"><?php echo $tab[1]['cname'] ?></div>
            <div><?php echo $tab[1]['cintro'] ?></div>
        </div>
    </div>
    <div class="box_tip_3" id="box_tip_3" style="cursor: pointer;" onclick="show_(3);">
        <div class="box_tip_text_3">
            <div class="f16px"><?php echo $tab[2]['cname'] ?></div>
            <div><?php echo $tab[2]['cintro'] ?></div>
        </div>
    </div>
    <div class="clear_left"></div>
</div>




<div class="content" id="content_1" style="display: block;">

    <div style="margin: 0; width: 700px;">
        <div class="title_download">
            Downloads <?php echo $tab[0]['cname'] ?>
        </div>
        <div class="page_download">
            <div class="paging">
                <!--<ul>
                    <li><a href="#">&lt;</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#" class="current">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">&gt;</a></li>
                </ul>-->
            </div>
        </div>
        <div class="clear"></div>
    </div>
    
    <div class="p10t">
    <?php
	if(isset($list1))
	{
		$i=0;
		foreach($list1 as $v)
		{
			$bg=($i%2==0)?" download_bg":"";
	?>
        <div class="download_items<?php echo $bg; ?>">
            <div class="download1">
                <div class="download_id">
                    <p><?php echo $v['itemid']; ?></p>
                </div>
            </div>
            <div class="download2">
                <div class="download_text">
                    <p><?php echo $v['name']; ?></p>
                </div>
            </div>
            <div class="download3">
                <div class="download_button">
                    <p><a href="<?php echo base_url()."en/getfile/".$v['downloadfile']; ?>">Download item</a></p>
                </div>
            </div>
            <div class="clear"></div>
        
        </div>
     <?php
		$i++;
		}
	}
	?>   
    </div>

</div>

<div class="content" id="content_2" style="display: none;">
    <div style="margin: 0; width: 700px;">
        <div class="title_download">
            Downloads <?php echo $tab[1]['cname'] ?>
        </div>
        <div class="page_download">
            <div class="paging">
                <!--<ul>
                    <li><a href="#">&lt;</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#" class="current">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">&gt;</a></li>
                </ul>-->
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="p10t">
            <?php
	if(isset($list2))
	{
		$i=0;
		foreach($list2 as $v)
		{
			$bg=($i%2==0)?" download_bg":"";
	?>
        <div class="download_items<?php echo $bg; ?>">
            <div class="download1">
                <div class="download_id">
                    <p><?php echo $v['itemid']; ?></p>
                </div>
            </div>
            <div class="download2">
                <div class="download_text">
                    <p><?php echo $v['name']; ?></p>
                </div>
            </div>
            <div class="download3">
                <div class="download_button">
                    <p><a href="<?php echo base_url()."en/getfile/".$v['downloadfile']; ?>">Download item</a></p>
                </div>
            </div>
            <div class="clear"></div>
        
        </div>
     <?php
		$i++;
		}
	}
	?> 
    </div>
</div>
<div class="content" id="content_3" style="display: none;">
    <div style="margin: 0; width: 700px;">
        <div class="title_download">
            Downloads <?php echo $tab[2]['cname'] ?>
        </div>
        <div class="page_download">
            <div class="paging">
                <!--<ul>
                    <li><a href="#">&lt;</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#" class="current">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">&gt;</a></li>
                </ul>-->
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="p10t">
            <?php
	if(isset($list3))
	{
		$i=0;
		foreach($list3 as $v)
		{
			$bg=($i%2==0)?" download_bg":"";
	?>
        <div class="download_items<?php echo $bg; ?>">
            <div class="download1">
                <div class="download_id">
                    <p><?php echo $v['itemid']; ?></p>
                </div>
            </div>
            <div class="download2">
                <div class="download_text">
                    <p><?php echo $v['name']; ?></p>
                </div>
            </div>
            <div class="download3">
                <div class="download_button">
                    <p><a href="<?php echo base_url()."en/getfile/".$v['downloadfile']; ?>">Download item</a></p>
                </div>
            </div>
            <div class="clear"></div>
        
        </div>
     <?php
		$i++;
		}
	}
	?> 
    </div>
</div>

<script>
jQuery(document).ready(function(){
	jQuery("#downloads_active").addClass('current');
	show_(1);
});
</script>